# while循环
i = 1
while i <= 100:
    print("好好学习，天天向上")
    i += 1

i = 1
s = 0
while i <= 100:
    print(i)
    s += i
    i += 1
print("计算结果：", s)
i = 1
while i <= 3:
    print(f"这是第{i}次外循环")
    j = 1
    while j <= 5:
        print(f"内循环{j}次")
        j += 1
    i += 1

s = 'hellopython'

for i in s:
    print(i)
# range() 函数 前闭后开区间
for i in range(1, 6):
    print(i)
s = 0
for i in range(1, 101):
    print(i)
    s += i
print("求得和", s)
# break
i = 1
while i <= 5:
    print(f"小红正在吃第{i}个苹果")
    if i == 3:
        print(f"小红吃饱了不吃了")
        break
    i += 1
# continue
i = 1
while i <= 5:
    print(f"小红正在吃第{i}个苹果")
    if i == 3:
        print(f"小红吃到了一条大虫子，第{i}个苹果不吃了")
        i += 1
        continue
    i += 1
